package conson.tech.manage.api.coupons.feign;

import cn.hutool.json.JSONUtil;
import conson.tech.core.constant.SecurityConstants;
import conson.tech.core.response.Response;
import conson.tech.manage.api.app.dto.AppAdvertDTO;
import conson.tech.manage.api.app.form.AppAdvertForm;
import conson.tech.manage.api.coupons.dto.UserCouponDetailDTO;
import conson.tech.manage.api.coupons.form.CouponOperForm;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;

/**
 * InterfaceName: CouponFeignService
 * Description: 营销优惠券
 * Author: GXT
 */
@FeignClient(name = "manage-operation", url = "${feignclient.manage-operation.domain:}")
@RequestMapping(SecurityConstants.INNERAPI + "/coupons")
public interface CouponFeignService {

    @PostMapping("/detail")
    Response<List<UserCouponDetailDTO>> couponConfigDetails(HttpServletRequest request,
                                                             @RequestBody CouponOperForm couponOperForm);

    @PostMapping("/lock")
    Response<Boolean> lockCoupon(HttpServletRequest request, @RequestBody CouponOperForm couponOperForm) ;


    @PostMapping("/unlock")
    Response<Boolean> unlockCoupon(HttpServletRequest request, @RequestBody CouponOperForm couponOperForm);

    @PostMapping("/applied")
    Response<Boolean> appliedCoupon(HttpServletRequest request, @RequestBody CouponOperForm couponOperForm);

    @PostMapping("/return")
    Response<Boolean> returnCoupon(HttpServletRequest request, @RequestBody CouponOperForm couponOperForm);
}
